/*-------------------------------------------------------------------------------------------------*
* Title: 		SOURCING2EQUAL COLOMBIA: ENDLINE DATA                                                                                          
* Description: 		Impact evaluation of WMSME procurement capacity-building interventions
*
* About:		Documenting data analysis and data decision made during the project cycle
*
* Start Date:		12/01/2025 	
* Status:		In progress
* End Data:													
* Research Team:	Rachel Cassidy, David McKenzie, Raaga Akkineni 							  
*-------------------------------------------------------------------------------------------------*/

/*-------------------------------------------------------------------------------------------------*

			**	PRE-ANALYSIS PLAN		**   //FIXMERA: Update with endline PAP

*-------------------------------------------------------------------------------------------------*/

Using the midline survey, we compare outcomes for those assigned to be treated in wave 1 (treatment), to those assigned to wait to be treated in waves 2 or 3 (control). The AEA registration (https://www.socialscienceregistry.org/trials/14881) noted that the primary outcomes were “Knowledge of the procurement process and related information, attitudes and actions towards participating in procurement, and procurement participation and related outcomes”. We operationalize these as follows:

Primary Outcomes:
1.	Procurement Knowledge: 
	This will be the sum of answers given to knowledge questions C1-C7, as follows:
		a.	Self-assessed knowledge (C1): 
			1 point if assessed as good, 2 points if assessed as expert/advanced.
		b.	Document knowledge (C2): 
			1 point for each of the three correct documents (Valid Chamber of Commerce registration,
			RUT, Active bank account),  
		c.	Information sources (C3): 
			1 point for each of the three correct sources (networking, LinkedIn, LicitacionesColombia.co), 
			subtract 1 point for each response more than 3 that is given.
		d.	Know process (C4): 
			1 point if answer 2 = open procurement process. 
		e.	Know financing cost (C5): 
			1 point if answer 3 = factoring
		f.	Knowledge of tender document (C6): 
			1 point for each of the three correct items (goods and services requested, documentation requirements, deadline), 
			subtract 1 point for each response more than 3 that is given.
		g.	Knowledge of value proposition (C7): 
			1 point for each of the two correct responses (client’s needs and requirements, client’s regulations), 
			subtract 1 point for each response more than 2 that is given.

2.	Procurement Attitude: 
	This is the average of the responses to the following items that are all scored on a 5-point Likert scale, 
	where a higher score means they have more confidence in being able to compete for procurement:
		a.	Confident can engage with corporate buyers (D1)
		b.	Confident that can compete for corporate contracts (D2)
		c.	Think corporations genuinely interested in contracting for social reasons (D4)
		d.	Think corporations genuinely interested in contracting for commercial reasons (D5)
		e.	Think winning is mostly about who you know (reverse code D6)

3.	Procurement Readiness: 
	This is the average of the responses to the following items that are all scored on a 5-point scale and which measure 
	efforts taken in the past 6 months to be more ready for competing for procurement contracts:
		a.	Conducted a market study (E3)
		b.	Improved understanding of the process (E7)
		c.	Discussed with new corporate buyers (E10)
		d.	Discussed with other women entrepreneurs to explore synergies (E11)
		e.	Made changes to improve offer/proposal (E13)
		f.	Used feedback from previous tender rejections to improve (E14). Code this as 1 also if N/A.

4.	Procurement Action 1: 
	Registered in New Corporate Portal. This is a binary variable which takes the value 1 if registered in a new portal, 0 otherwise (E17)

5.	Procurement Action 2: 
	Submitted a Bid to a Corporate Buyer in last 6 months. A binary variable which takes value 1 if F1.1.>0, and 0 otherwise. (F1.1)

6.	Procurement Outcome: 
	Successful in a Bid. A binary variable which takes value 1 if they won a new supply contract in the past 6 months (F1.2>0) 
	and 0 otherwise (F1.2). Coded as 0 if they did not bid for any contracts.

Secondary Outcomes:
We will also look at several other aspects of the procurement process and firm outcomes, which are expected to be noisier, be less directly linked to the program, or take longer to change:

1.	Number of Bids Submitted to Corporates: Winsorized at the 99th percentile (F1.1)
2.	Number of Bids Won: Winsorized at the 99th percentile (F1.2)
3.	Revenue from Corporate Contracts in Last 6 months: Winsorized at the 99th percentile (F2)
4.	Submitted a Bid to a MSME Supplier: Binary variable which takes value 1 if F2.1>0) and 0 otherwise.
5.	Won a Bid with a MSME Supplier: Binary variable which takes value 1 if F2.2>0, and 0 otherwise. Coded as 0 if they did not bid for a MSME contract.
6.	Submitted a Bid to a Public Buyer: Binary variable which takes value 1 if F3.1>0, and 0 otherwise.
7.	Won a Bid with a Public Buyer: Binary variable which takes value 1 if F3.2>0, and 0 otherwise. Coded as 0 if they did not bid for a public contract.
8.	Employees hired for new contracts in past 6 months: Winsorized at the 99th percentile (sum of F8 and F9, coded as 0 if F7=0, or if no contracts won).

Estimation

Estimation of the ITT

We will use the midline data to estimate the intention-to-treat effect, which is the effect of being assigned to the Sourcing 2 Equal treatment. In the midline analysis this will involve running regressions of the form:

		Outcome = a + b*Assigned to Wave 1 + c’Strata + e

Where Strata are dummies for the 24 randomization Strata (training city * firm size (SME vs eligible micro * having some procurement knowledge * having a corporate client).

We will aim to improve power and reduce any imbalances due to attrition by using PDS Lasso to further select additional covariates from the following baseline list, partialling out the randomization strata and the lagged outcome variable where available:

- Number of employees (winsorized at the 99th percentile), 
- log income in 2023, age of the company (winsorized at the 99th percentile) 
- previously registered in a corporate database
- number of previous corporate database registrations (winsorized at the 99th percentile)
- level of previous procurement knowledge
- has an existing corporate client
- number of corporate clients (winsorized at the 99th percentile)
- income from procurement contracts above median
- sector (dummies created for 3 main sectors)
- dummies if the SMEs are primarily women-owned or women-led.


Complier Weighted Treatment Effect 
The Sourcing 2 Equal program uses a funnel approach, with three stages, with all firms invited to a masterclass, a subset invited to a bootcamp, and a smaller subset then invited to mentoring. We would expect impacts to be greater for those who get more of the program. We will explore using the Coussens and Spiess compliance-weighted estimator to improve power. If we assume that there is no impact of being invited to the masterclasses if you do not attend (which seems reasonable), then we can use baseline covariates to predict masterclass attendance and put more weight in the IV on individuals more likely to attend. Doing this to measure the impacts for the group attending the bootcamp would require an exclusion restriction of no impact of the masterclass by itself, which may be more reasonable for some outcomes than others. 


/*-------------------------------------------------------------------------------------------------*

			**		DATA OBSERVAIONS		**

*-------------------------------------------------------------------------------------------------*/

	
/*-------------------------------------------------------------------------------------------------*
    				*General Statistics*
*--------------------------------------------------------------------------------------------------*/

Number of respondents: 623 + 
	     	      
	-----------------------------------------------------------------
	|   Complete	|   Incomplete 	|	Shorter	|	Total	|
	|		|		|	Survey	|		|
	-----------------------------------------------------------------
	|      621	| 	2	|	41	|	623	|
	-----------------------------------------------------------------			

Mode of Survey:  

	-----------------------------------------------------------------
	|   In-Person	|	Link	|	Phone	|	Total	|
	-----------------------------------------------------------------
	|      43	|	213	|	367	|	623	|
	-----------------------------------------------------------------


Endline Respondents by Wave:

	-----------------------------------------
	| Treatment |				|
	|      Wave |      Freq.     Percent    |
	|-----------+---------------------------|
	|         1 |        204       32.74    |
	|         2 |        191       30.66    |
	|         3 |        228       36.60    |
	|-----------+---------------------------|
	|     Total |        623      100.00	|
	-----------------------------------------

Endline Respondents by City: 

	-----------------------------------------
	| City	  |      Freq.     Percent      |
	|---------+-----------------------------|
	| Bogota  |        325       52.17      |
	| Cali	  |         85       13.64      |
	| Medellin|        213       34.19      |
	----------+-----------------------------|
        |   Total |        623      100.00	|
	-----------------------------------------




/*-------------------------------------------------------------------------------------------------*
    				*Primary Outcomes*
*--------------------------------------------------------------------------------------------------*/

Outcome Variable	|		Var Label				|     N (715)	| Reason for discrepancy
 	
out1_knowledge		|	Procurement Knowledge (-1 - 12)			|	715	| -
out1_readiness		|	Procurement Attitude				|	712	| 3 incomplete surveys
out1_readiness 		|	Procurement Readiness				|	712	| 3 incomplete surveys	

out1_proc_act1		| Procurement Action 1: Registered to corporate portal	|	683	| 3 incomplete surveys, 4 RTAs, 25 IDKs
out1_proc_act2 		| Procurement Action 2: Submit corporate bid in last 6m	|	705	| 3 incomplete surveys, "Ever submitted bid": 3 RTAs (IDKs coded as 0)
out1_proc_act3 		| Procurement Action 3: Won corporate bid in last 6m	|	314	| 3 incomplete surveys, +3  "Eve  submitted bid": 3 RTAs) (10 submitted a bid but 												  										  refused to answer how many coded as zero)
	

/*-------------------------------------------------------------------------------------------------*
    				*Secondary Outcomes*
*--------------------------------------------------------------------------------------------------*/

Outcome Variable	|		Var Label				|     N (715)	| Reason for discrepancy

out2_corporate_bids_m	| 	Bids submitted to corporates			| 	695  	| 10 missing out1_proc_act2 + 10 submitted bids but responded RTA/IDK for how many
out2_corporate_bidswon_m| 	Bids won from corporates			| 	309  	| 381 did not submit a corporate bid + 5 IDKs/RTAs
out2_corporate_revenue_m| 	Revenue from corporate bids			| 	695  	| 77 did not win corporate contract + 30 IDKs/RTAs
out2_coporate_hire_m	|	No of employees hired				|	 183	|


out2_msme_bids_m	|	Bids submitted to MSMEs				| 	 614	| 34 IDKs/RTAs + 66 missing because of skip error during 												  survey + 1 unaccounted for (FIXMERA)
out2_msme_bidswon_m 	|       Bids won from MSMEs 				| 	 412	| 199 never submitted a MSME bis, 3 IDKs/RTAs
// out2_msme_revenue_m	|       Revenue from MSMEs bids 			| 	 297	| 59 did not win MSME bids, 56 IDKs/RTAs  // did not use in outcome

out2_public_bids_m	|	Bids submitted to public buyers			| 	 614	| 10 IDKs/RTAs + 66 missing because of skip error during 												  survey + 1 unaccounted for (FIXMERA)
out2_public_bidswon_m 	|       Bids won from public buyers			| 	 159	| 478 never submitted a public, 1 IDKs/RTAs
// out2_public_revenue_m|       Revenue from public buyers bids			| 	 63	| 82 did not win public bids, 14 IDKs/RTAs  // did not use in outcome


/*-------------------------------------------------------------------------------------------------*
    				*Control*
*--------------------------------------------------------------------------------------------------*/		

Variable		|		Var Label				|  N (1,105)	| Reason for discrepancy

employees_w_b		| 	Employees (2023) (winsorized)			| 	1,105  	| -
income_2023_log_b	| 	Log of 2023 income				| 	1,099  	| 6 entries with income_2023  = 0, including 4 that were found at midline
company_age_w_b		| 	Company age (2023) (winsorized)			| 	1,105	| 
registered_database_b	|	Registered in corporate database		| 	1,105	| -
procurement_database_w_b|	No.of registered databases (2023) (Winsorized)	|	1,105	| -
procurement_knowledge_num_b|	Procurement knowledge (baseline)		|	1,105	| -
corporate_clients_w_b	|	No if corporate client (2023) (Winsorized)	|	1,105	| -
procincome_2023_abovemed|	Above median procurement income (2023)		|	1,073	| 32 firms said they won contracts but did not answer income from wins, including 16 found at midline
sector_major3_b		|	Major sector					| 	1,105	| -		 
women_owned_b		|	Women own more than 51% 			| 	1,105	| -

/*-------------------------------------------------------------------------------------------------*
    				*Strata*
*--------------------------------------------------------------------------------------------------*/	

Variable			|	Var Label				|  N (1,105)	| Reason for discrepancy

rct_city_b			| 	RCT_city				| 	1,105  	| -
rct_firmsize_bi_b		|	Firm size: MSME				| 	1,105  	| -
procurement_knowledge_dummy_b	| 	Some procurement knowledge		| 	1,105  	| -
corporate_clients_dummy_b	|	Procured clients			| 	1,105	| - 									
